def test1():
    weekT = {'h': 'thursday',
             'u': 'tuesday'}
    weekS = {'a': 'saturday',
             'u': 'sunday'}
    week = {'t': weekT,
            's': weekS,
            'm': 'monday',
            'w': 'wensday',
            'f': 'friday'}
    a = week[str(input('请输入第一位字母:')).lower()]
    if a == weekT or a == weekS:
        print(a[str(input('请输入第二位字母:')).lower()])
    else:
        print(a)
def test2():
    a = ['one', 'two', 'three']
    b= a[:]
    print(a[::-1])
    print(b)

class bcolors:
    HEADER = '\033[95m'
    OKBLUE = '\033[94m'
    OKGREEN = '\033[92m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'
    i = -999
    def __init__(self):
        self.i = 8888
def test3():
    b = bcolors()
    print(bcolors.HEADER+str(b.i))
    print(bcolors.WARNING + "警告的颜色字体?" + bcolors.ENDC)

    for i in range(10):
        print( str(i))

    L = [1,2,3,4,5]
    a = "aaa"
    for ll in L:
        print(ll)
    print(','.join(str(n) for n in L))

def test4():
    X = [[12, 7, 3],
         [4, 5, 6],
         [7, 8, 9]]

    Y = [[5, 8, 1],
         [6, 7, 3],
         [4, 5, 9]]

    res = [[0, 0, 0],
           [0, 0, 0],
           [0, 0, 0]]
    for i in range(len(res)):
        for j in range(len(res[0])):
            res[i][j] = X[i][j] + Y[i][j]
    print(res)

def test5():
    Max= lambda   x,y:x*(x>=y)+y*(y>x)
    Min=lambda x,y:x*(x<=y)+y*(y<x)

    a=int(input('1:'))
    b=int(input('2:'))

    print(Max(a,b))
    print(Min(a,b))

def test6():
    i = int(input("input i:"))
    print('i=0x'+bin(~i))
    if __name__=='__main__':
       i =0

from tkinter import *
def test7():


    canvas = Canvas(width=300, height=300, bg='green')
    canvas.pack(expand=YES, fill=BOTH)
    x0 = 263
    y0 = 263
    y1 = 275
    x1 = 275
    for i in range(19):
        canvas.create_line(x0, y0, x0, y1, width=1, fill='red')
        x0 = x0 - 5
        y0 = y0 - 5
        x1 = x1 + 5
        y1 = y1 + 5

    x0 = 263
    y1 = 275
    y0 = 263
    for i in range(21):
        canvas.create_line(x0, y0, x0, y1, fill='red')
        x0 += 5
        y0 += 5
        y1 += 5

    mainloop()

def test8():
    person = {"li": 18, "wang": 50, "zhang": 20, "sun": 22}
    m = 'li'

    for key in person.keys():
        if person[m] < person[key]:
            m = key

    print('%s,%d' % (m, person[m]))


from sys import stdout
filename = input('输入文件名:\n')
fp = open(filename,"w")
ch = input('输入字符串:\n')
while ch != '#':
    fp.write(ch)
    stdout.write(ch)
    ch = input('')
fp.close()

